<?php include('header.php'); ?>
<script type="text/javascript">
function areyousure()
{
	return confirm('<?php echo 'Apakah Anda yakin akan menghapus Restoran ini?';?>');
}
</script>

<div style="text-align:right">
	<a class="btn" href="<?php echo site_url($this->config->item('admin_folder').'/restaurants/form'); ?>"><i class="icon-plus-sign"></i> <?php echo 'Tambah Restoran Baru';?></a>
</div>

<table class="table table-striped">
    <thead>
		<tr>
			<th><?php echo lang('restaurant_id');?></th>
			<th><?php echo lang('name')?></th>
			<th></th>
		</tr>
	</thead>
	<tbody>
		<?php echo (count($restaurants) < 1)?'<tr><td style="text-align:center;" colspan="3">'.lang('no_categories').'</td></tr>':''?>
		<?php
		define('ADMIN_FOLDER', $this->config->item('admin_folder'));
		function list_restaurants($ress, $sub='') {
			
			foreach ($ress as $res):?>
			<tr>
				<td><?php echo  $res['restaurant']->id; ?></td>
				<td><?php echo  $res['restaurant']->name; ?></td>
				<td>
					<div class="btn-group" style="float:right">

						<a class="btn" href="<?php echo  site_url(ADMIN_FOLDER.'/restaurants/form/'.$res['restaurant']->id);?>"><i class="icon-pencil"></i> <?php echo lang('edit');?></a>

						<!--a class="btn" href="<?php echo  site_url(ADMIN_FOLDER.'/restaurants/organize/'.$res['restaurant']->id);?>"><i class="icon-move"></i> <?php echo lang('organize');?></a-->
						
						<a class="btn btn-danger" href="<?php echo  site_url(ADMIN_FOLDER.'/restaurants/delete/'.$res['restaurant']->id);?>" onclick="return areyousure();"><i class="icon-trash icon-white"></i> <?php echo lang('delete');?></a>
					</div>
				</td>
			</tr>
			<?php
			
			endforeach;
		}
		
		list_restaurants($restaurants);
		?>
	</tbody>
</table>
<?php include('footer.php');